#放入电池
execute if function vs:system/game_ctrol/guard_tower/power/if/interaction_is_clicked run function vs:system/game_ctrol/guard_tower/power/try_place_battery

#取出电池
execute if function vs:system/game_ctrol/guard_tower/power/if/interaction_is_hit run function vs:system/game_ctrol/guard_tower/power/try_take_battery

#充电
execute unless score @s short_circuit_timer matches -2147483648..2147483647 if data entity @s item.components."minecraft:custom_data".guardTowerData{PowerInputEmpty:false} unless function vs:system/game_ctrol/guard_tower/power/if/is_max_power run function vs:system/game_ctrol/guard_tower/power/charge

#Enable Disable
execute as @s[scores={Power=..0},tag=isEnable] unless score @s short_circuit_timer matches -2147483648..2147483647 run return run function vs:system/game_ctrol/guard_tower/disable
execute as @s[scores={Power=1..},tag=!isEnable] unless score @s short_circuit_timer matches -2147483648..2147483647 run return run function vs:system/game_ctrol/guard_tower/enable